package com.example.demo.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author gatts, 2020/8/4 21:20
 */
@Component
@PropertySource(value = "classpath:book.properties")
public class Book {

    @Value(value = "${book.name}")
    private String bookName;

    @Value(value = "${author}")
    private String author;

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", author='" + author + '\'' +
                '}';
    }
}
